<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="guestbook.Greeting" %>
<%@ page import="guestbook.Box" %>
<%@ page import="guestbook.PMF" %>
<%@ page import="guestbook.FDT_data" %>
<%@ page import="guestbook.PK_data" %>

  
  						<%
									PersistenceManager pm = PMF.get().getPersistenceManager();
									String query = "select from " + FDT_data.class.getName();
									List<FDT_data> fdt_datas = (List<FDT_data>) pm.newQuery(query).execute();
									if (fdt_datas.isEmpty()) {
							%>

							<p>The FDT_data is empty.</p>

							<%
									} else {
							%>
							
							{ "ftd": [
							
							<%
											for (FDT_data f : fdt_datas) {
							%>
							
							{
							"nome_strada" : "<%= f.get_road_name() %>",
							"id_strada" 	: "<%= f.get_road_LCD() %>",
							"lat" 				: "<%= f.get_lat() %>",
							"lng" 				: "<%= f.get_lng() %>",
							"flow" 				: "<%= f.get_flow() %>",
							"speed" 			: "<%= f.get_speed() %>",
							"dir" 				: "<%= f.get_direction() %>"
							} ,
							
							<%
											}
									}
									pm.close();
							%>
							{
							"nome_strada" : "",
							"id_strada" 	: "",
							"lat" 				: "",
							"lng" 				: "",
							"flow" 				: "",
							"speed" 			: "",
							"dir" 				: ""
							} 
							]}
